
//#include "..\SystemInitialData\SystemInformation.h"


/***********************************************
 * not put the data in memory
 * this is for SOC function to use
 ***********************************************/
//#define SOC_BATTERY_OV_VOLTAGE     __2ND_BATTERY_OV_PROTECTION_     //5600
//#define SOC_BATTERY_UV_VOLTAGE     __2ND_BATTERY_UV_PROTECTION_     //3700
//#define SOC_1st_CELL_OV_VOLTAGE     4250 //mV
//#define SOC_1st_CELL_UV_VOLTAGE     2500 //mV


#define OCV_TABLE_POINTS 51
#define NUM_OF_OCV_LINE  1

#define RESIDUAL_CAPACITY_INDEX         0
#define RESIDUAL_OCV_CURRENT_INDEX      1


/*
; TERMINAL_VOLTAGE units is mV
; RESIDUAL_CAPACITY units is percentage
; Please sort from largest to smallest
// 2600mAh cell, 25 degree, OCV Table
*/

const unsigned int RealOCVTable[OCV_TABLE_POINTS][NUM_OF_OCV_LINE+1] =
{
////////////// RESIDUAL CAPACITY ////////////////////////////////////////////////////////////////
//7.8Ah      OCV     
//Capacity,   OCV,        ///////////////////////
//   (%)      (mV)   
    { 100,   41850,   },   //index = 00       
    { 98 ,   41616,   },   //index = 01       
    { 96 ,   41381,   },   //index = 02       
    { 94 ,   41172,   },   //index = 03       
    { 92 ,   40969,   },   //index = 04       
    { 90 ,   40766,   },   //index = 05       
    { 88 ,   40577,   },   //index = 06       
    { 86 ,   40389,   },   //index = 07       
    { 84 ,   40209,   },   //index = 08       
    { 82 ,   40046,   },   //index = 09       
    { 80 ,   39874,   },   //index = 10       
    { 78 ,   39720,   },   //index = 11       
    { 76 ,   39572,   },   //index = 12       
    { 74 ,   39426,   },   //index = 13       
    { 72 ,   39294,   },   //index = 14       
    { 70 ,   39161,   },   //index = 15       
    { 68 ,   39043,   },   //index = 16       
    { 66 ,   38931,   },   //index = 17       
    { 64 ,   38815,   },   //index = 18       
    { 62 ,   38722,   },   //index = 19       
    { 60 ,   38622,   },   //index = 20       
    { 58 ,   38475,   },   //index = 21       
    { 56 ,   38286,   },   //index = 22       
    { 54 ,   38122,   },   //index = 23       
    { 52 ,   37980,   },   //index = 24       
    { 50 ,   37895,   },   //index = 25       
    { 48 ,   37838,   },   //index = 26       
    { 46 ,   37778,   },   //index = 27       
    { 44 ,   37755,   },   //index = 28       
    { 42 ,   37731,   },   //index = 29       
    { 40 ,   37712,   },   //index = 30       
    { 38 ,   37696,   },   //index = 31       
    { 36 ,   37681,   },   //index = 32       
    { 34 ,   37662,   },   //index = 33       
    { 32 ,   37645,   },   //index = 34       
    { 30 ,   37616,   },   //index = 35       
    { 28 ,   37557,   },   //index = 36       
    { 26 ,   37526,   },   //index = 37       
    { 24 ,   37398,   },   //index = 38       
    { 22 ,   37271,   },   //index = 39       
    { 20 ,   37118,   },   //index = 40       
    { 18 ,   36837,   },   //index = 41       
    { 16 ,   36564,   },   //index = 42       
    { 14 ,   36264,   },   //index = 43       
    { 12 ,   35971,   },   //index = 44       
    { 10 ,   35714,   },   //index = 45       
    { 8  ,   35511,   },   //index = 46       
    { 6  ,   35295,   },   //index = 47       
    { 4  ,   34857,   },   //index = 48       
    { 2  ,   33775,   },   //index = 49       
    { 0  ,   31490,   }    //index = 50 
};                                                            



#define CHG_OCV_TABLE_POINTS            41
#define CHG_NUM_OF_OCV_LINE             3
#define RESIDUAL_CHG_CAPACITY_INDEX         0
#define RESIDUAL_CHG_1st_TEMPERATURE_INDEX  1
#define RESIDUAL_CHG_2nd_TEMPERATURE_INDEX  2
#define RESIDUAL_CHG_3rd_TEMPERATURE_INDEX  3

const unsigned int CHG_RealOCVTable[CHG_OCV_TABLE_POINTS][CHG_NUM_OF_OCV_LINE +1] =
{
////////////// RESIDUAL CAPACITY ////////////////////////////////////////////////////////////////////////////
//          7.8Ah        1st          2nd         3rd   /////////////////////////////////////////////////////
//         Capacity,    CHG 2A,     CHG 2A,      CHG 2A,/////////////////////////////////////////////////////
//           * 100    Lower Temp,  Middle Temp, Higher Temp   ///////////////////////////////////////////////
//            (%)        (mV)          (mV)         (mV)      ///////////////////////////////////////////////
{		10000	,			41855,			41868,			41881	},		//index = 00
{		9750	,			41783,			41779,			41775	},		//index = 01
{		9500	,			41705,			41687,			41668	},		//index = 02
{		9250	,			41625,			41593,			41562	},		//index = 03
{		9000	,			41545,			41501,			41458	},		//index = 04
{		8750	,			41480,			41426,			41371	},		//index = 05
{		8500	,			41369,			41306,			41243	},		//index = 06
{		8250	,			41179,			41105,			41031	},		//index = 07
{		8000	,			41024,			40932,			40840	},		//index = 08
{		7750	,			40872,			40739,			40606	},		//index = 09
{		7500	,			40743,			40556,			40370	},		//index = 10
{		7250	,			40633,			40392,			40151	},		//index = 11
{		7000	,			40521,			40231,			39942	},		//index = 12
{		6750	,			40421,			40111,			39802	},		//index = 13
{		6500	,			40323,			40011,			39699	},		//index = 14
{		6250	,			40242,			39922,			39601	},		//index = 15
{		6000	,			40157,			39824,			39491	},		//index = 16
{		5750	,			40075,			39737,			39398	},		//index = 17
{		5500	,			39994,			39656,			39317	},		//index = 18
{		5250	,			39925,			39578,			39232	},		//index = 19
{		5000	,			39871,			39521,			39172	},		//index = 20
{		4750	,			39809,			39454,			39098	},		//index = 21
{		4500	,			39749,			39389,			39029	},		//index = 22
{		4250	,			39680,			39315,			38950	},		//index = 23
{		4000	,			39648,			39271,			38894	},		//index = 24
{		3750	,			39594,			39204,			38814	},		//index = 25
{		3500	,			39548,			39145,			38741	},		//index = 26
{		3250	,			39500,			39084,			38668	},		//index = 27
{		3000	,			39454,			39025,			38595	},		//index = 28
{		2750	,			39403,			38962,			38520	},		//index = 29
{		2500	,			39350,			38907,			38463	},		//index = 30
{		2250	,			39187,			38766,			38346	},		//index = 31
{		2000	,			38856,			38452,			38049	},		//index = 32
{		1750	,			38178,			37779,			37380	},		//index = 33
{		1500	,			37578,			37164,			36751	},		//index = 34
{		1250	,			37038,			36596,			36154	},		//index = 35
{		1000	,			36667,			36248,			35829	},		//index = 36
{		750		,  			36362,			35917,			35472	},		//index = 37
{		500		,  			36063,			35550,			35037	},		//index = 38
{		250		,  			34907,			34070,			33232	},		//index = 39
{		0		,  			29000,			29000,			29000	} 		//index = 40

};


//#define TERMINAL_VOLTAGE_INDEX 0                            
//#define RESIDUAL_CAPACITY_INDEX 1                           
//                                                            
//const int RealOCVTable[OCV_TABLE_POINTS][2] =               
//{                                                           
//  {  4087,  9994  },    //index=00,  1st                    
//  {  3997,  9496  },    //index=01,  2nd                    
//  {  3941,  8998  },    //index=02,  3rd                    
//  {  3890,  8499  },    //index=03,  4th                    
//  {  3843,  8000  },    //index=04,  5th                    
//  {  3800,  7501  },    //index=05,  6th                    
//  {  3761,  7002  },    //index=06,  7th                    
//  {  3727,  6504  },    //index=07,  8th                    
//  {  3695,  6005  },    //index=08,  9th                    
//  {  3666,  5507  },    //index=09,  10th                   
//  {  3641,  5009  },    //index=10,  11th                   
//  {  3618,  4510  },    //index=11,  12th                   
//  {  3596,  4012  },    //index=12,  13th                   
//  {  3572,  3513  },    //index=13,  14th                   
//  {  3544,  3015  },    //index=14,  15th                   
//  {  3511,  2515  },    //index=15,  16th                   
//  {  3473,  2016  },    //index=16,  17th                   
//  {  3432,  1518  },    //index=17,  18th                   
//  {  3381,  1019  },    //index=18,  19th                   
//  {  3299,  521   },    //index=19,  20th                   
//  {  2748,  0     }     //index=20,  21th                   
//};                                                          
                                                              
                                                              
